<?php echo $this->Html->script(array('jquery-1.11.2.min'));?>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
    <div class="row clearfix">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">

            <div role="tabpanel">

                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Thông tin <?php echo $supportServiceDetail['SupportService']['name'] ?></a></li>
                    <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Liên hệ</a></li>
                </ul>

                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="home"> <?php echo $supportServiceDetail['SupportService']['content'] ?></div>
                    <div role="tabpanel" class="tab-pane" id="profile">
                        <span style="font-weight: bold">Mọi thông tin về <?php echo $supportServiceDetail['SupportService']['name'] ?> quý khách vui lòng liên hệ theo mẫu dưới đây</span>

                        <?php echo $this->Form->create('Post', [
                            'url' => ['controller' => 'Mypages', 'action' => 'supportinformation']
                        ]); ?>

                        <?php
                        echo $this->Form->input(
                            'customername',
                            array('label' => 'Họ Tên(*)')
                        );
                        ?>
                        <div id = "txtcustomername" class="hidden" style="color: red">Vui long nhap ten</div>

                        <?php
                        echo $this->Form->input(
                            'customercompany',
                            array('label' => 'Công Ty')
                        );
                        ?>

                        <?php
                        echo $this->Form->input(
                            'customeremail',
                            array('label' => 'Địa chỉ Email:')
                        );
                        ?>

                        <?php
                        echo $this->Form->input(
                            'customeraddress',
                            array('label' => 'Địa chỉ')
                        );
                        ?>

                        <?php
                        echo $this->Form->input(
                            'customerphone',
                            array('label' => 'Số điện thoại (*)')
                        );
                        ?>
                        <div id = "txtcustomerphone" class="hidden" style="color: red">Vui long số điện thoại</div>

                        <?php echo $this->Form->textarea(
                            'customerrequest',
                            array('label' => 'Yêu cầu', 'style'=>'width:630px; height: 200px')
                        );?>

                        <?php
                        $options = array(
                            'label' => 'Đăng kí',
                            'id' => 'submit',
                            'onclick' => 'return validate()'
                        );
                        echo $this->Form->end($options);
                        ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    function validate(){
        var name = $('#PostCustomername').val();
        var phone = $('#PostCustomerphone').val();
        var validate = true;
        if (!name){
            $( "#txtcustomername" ).removeClass( "hidden" );
            validate = false;
        }else{
            $( "#txtcustomername" ).addClass( "hidden" )
        }
        if (!phone){
            $( "#txtcustomerphone" ).removeClass( "hidden" );
            validate = false;
        }else{
            $( "#txtcustomerphone" ).addClass( "hidden" )
        }
        return validate;
    }
</script>

